package com.mingqijia.gassafety.authority.api.req.company;

import com.mingqijia.gassafety.shared.cqrs.AuthoritySupportReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 新增或更改第三方信息
 * @author Damon S.
 * @version v0.2
 * @date 2022-02-26 18:06
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "新增或更改第三方系统信息")
public class CompanyThirdPartyDTO extends AuthoritySupportReq implements Serializable {

    @NotNull(message = "企业ID不能为空")
    @ApiModelProperty(value = "企业ID", required = true)
    private String spId;

    @ApiModelProperty(value = "企业代码")
    private String code;

    @ApiModelProperty(value = "企业名称")
    private String name;

    @ApiModelProperty(value = "第三方系统", required = true)
    private List<ThirdPartyInfoDTO> thirdParties;

    @Data
    @ApiModel(value = "第三方系统信息")
    public static class ThirdPartyInfoDTO implements Serializable {

        @NotNull(message = "企业ID不能为空")
        @ApiModelProperty(value = "第三方系统编码(从字典取值)", required = true)
        private String tpCode;

        @ApiModelProperty(value = "第三方系统名称(从字典取值)", required = true)
        private String tpName;

        @NotNull(message = "企业ID不能为空")
        @ApiModelProperty(value = "企业代码", required = true)
        private String spCode;

        @ApiModelProperty(value = "区域代码")
        private String region;
    }
}
